<?php

require('../../public/common.php');

$username = $_POST["username"];

$query_avatar = mysqli_query($connect, "select avatar from users where username='".$username."';");

if (!$query_avatar) {

    die(json_encode(array("code" => "500","msg"=>"获取失败")));

}

$avatar = mysqli_fetch_assoc($query_avatar)['avatar'];

die(json_encode(array("code"=>0,"msg"=>"获取成功","avatar"=>$avatar)));
